home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_tem_fogt2shaft.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  88 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEM_FogT2Shaft.cog
  4. #
  5. # [MDR] && [TRM]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. # ========================================================================================
  9.  
  10. symbols
  11.  
  12.     message     entered
  13.     message     pulse
  14.     
  15.     thing       player          local
  16.     thing       fogGhost
  17.     
  18.     sector      tiki2Shaft
  19.     sector      lavaRoom
  20.                        
  21.     vector      vec_facing      local
  22.     
  23.     int         inShaft=0        local
  24.     
  25. end
  26.  
  27. # ========================================================================================
  28.  
  29. code
  30.  
  31. entered:
  32.  
  33.     player = GetLocalPlayerThing();
  34.     
  35.     if(GetSenderRef() == tiki2Shaft)
  36.     {
  37.         Print("entered tiki2Shaft");
  38.         inShaft = 1;
  39.         SetPulse(0.5);
  40.     }
  41.     
  42.     if(GetSenderRef() == lavaRoom)
  43.     {
  44.         Print("entered lavaRoom");
  45.         inShaft = 0;
  46.         SetPulse(0.0);
  47.         
  48.         # set fog to red
  49.         SetFog(1, '0.5, 0.05 0.05', 50, 190);       # 70, 150
  50.     }
  51.         
  52.     return;
  53.         
  54. # ========================================================================================
  55.  
  56. pulse:
  57.  
  58.     vec_facing = VectorSub( GetThingPos(fogGhost), GetThingPos(player));
  59.     vec_facing = VectorNorm(vec_facing);
  60.     
  61.     if(inShaft == 1)
  62.     {
  63.         if (VectorDot(GetThingLVec(player), vec_facing) >= 0)
  64.         {
  65.             # Player is facing fogGhost
  66.             # set fog to red
  67.             #SetFog(1, '0.5, 0.05 0.05', 40, 125);
  68.             SetFog(1, '0.5, 0.05 0.05', 50, 190);
  69.         }
  70.         
  71.         else
  72.         {
  73.             # player's back is to fogGhost
  74.             # change fog values to blue
  75.             SetFog(1, '0.50 0.50 0.60', 10, 350);
  76.         }
  77.     }
  78.     
  79.     else
  80.         return;
  81.     
  82.     return;
  83.         
  84. # ========================================================================================
  85.  
  86. end
  87.  
  88.